Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Loading Environment Variables from .env Files #311

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

JamborJan
Copy link

Hello Telmate/proxmox-api-go maintainers,

I am just starting to contribute to the Proxmox ecosystem. I want to see a nice and useful terraform provider and do my part to it. As I learned now the Telmate/proxmox-api-go is the first crucial thing and I cloned the repo to play around with it to get started.

My Motivation:
When it came to exporting environment variables to setup the configuration, I thought .env files would be a nice thing to have. I usually have multiple small projects ongoing at the same time and always having to type export KEY=value is error prone and as it is part of the bash history also insecure.

Implementation:
To address this, I have integrated the godotenv package, which allows the application to automatically load environment variables from a .env file at runtime. This means users can now store their sensitive credentials safely in .env files, significantly reducing the risk of accidental exposure, mixing up things etc. I also added .env to the gitignore file, everybody should know that this is a sensitive file which must not be shared.

Changes Made:

  • Added godotenv as a dependency in go.mod.
  • Implemented .env file loading logic in the main initialization section of the application.
  • Updated the README.md to include instructions on how to use .env files with the Proxmox API Go client.

Thank you for considering my PR.

README.md Show resolved Hide resolved
@mleone87
Copy link
Collaborator

@JamborJan please fix linting issues

@JamborJan
Copy link
Author

Hi @mleone87, I guess you asked me to fix the staticcheck error. I did that. Fixing the linting would involve a ton of work as the whole project is not properly setup. I can do that. But I would prefer to do this in a separate issue / pull request to not have scope creep in this specific PR. Are you okay with that? Thank you.

@mleone87
Copy link
Collaborator

@JamborJan it's ok I was just referring to the lint error on this commit, other are warnings!

@JamborJan
Copy link
Author

Thank you @mleone87 . Anyway if we want to get rid of the warnings I can do that. Sort of a probation to get my credits for becoming a proper contributor 😅

@mleone87 mleone87 merged commit b043e37 into Telmate:master Feb 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants